package ai.people.core.grpc.lib.user;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.42.0)",
    comments = "Source: user/user.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class UserServiceGrpc {

  private UserServiceGrpc() {}

  public static final String SERVICE_NAME = "user.UserService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<ai.people.core.grpc.lib.user.LoginRequest,
      ai.people.core.grpc.lib.user.LoginResponse> getLoginUserInfoMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "loginUserInfo",
      requestType = ai.people.core.grpc.lib.user.LoginRequest.class,
      responseType = ai.people.core.grpc.lib.user.LoginResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<ai.people.core.grpc.lib.user.LoginRequest,
      ai.people.core.grpc.lib.user.LoginResponse> getLoginUserInfoMethod() {
    io.grpc.MethodDescriptor<ai.people.core.grpc.lib.user.LoginRequest, ai.people.core.grpc.lib.user.LoginResponse> getLoginUserInfoMethod;
    if ((getLoginUserInfoMethod = UserServiceGrpc.getLoginUserInfoMethod) == null) {
      synchronized (UserServiceGrpc.class) {
        if ((getLoginUserInfoMethod = UserServiceGrpc.getLoginUserInfoMethod) == null) {
          UserServiceGrpc.getLoginUserInfoMethod = getLoginUserInfoMethod =
              io.grpc.MethodDescriptor.<ai.people.core.grpc.lib.user.LoginRequest, ai.people.core.grpc.lib.user.LoginResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "loginUserInfo"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  ai.people.core.grpc.lib.user.LoginRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  ai.people.core.grpc.lib.user.LoginResponse.getDefaultInstance()))
              .setSchemaDescriptor(new UserServiceMethodDescriptorSupplier("loginUserInfo"))
              .build();
        }
      }
    }
    return getLoginUserInfoMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.google.protobuf.Int64Value,
      com.google.protobuf.Empty> getUpdateLastLoginTimeMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "updateLastLoginTime",
      requestType = com.google.protobuf.Int64Value.class,
      responseType = com.google.protobuf.Empty.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<com.google.protobuf.Int64Value,
      com.google.protobuf.Empty> getUpdateLastLoginTimeMethod() {
    io.grpc.MethodDescriptor<com.google.protobuf.Int64Value, com.google.protobuf.Empty> getUpdateLastLoginTimeMethod;
    if ((getUpdateLastLoginTimeMethod = UserServiceGrpc.getUpdateLastLoginTimeMethod) == null) {
      synchronized (UserServiceGrpc.class) {
        if ((getUpdateLastLoginTimeMethod = UserServiceGrpc.getUpdateLastLoginTimeMethod) == null) {
          UserServiceGrpc.getUpdateLastLoginTimeMethod = getUpdateLastLoginTimeMethod =
              io.grpc.MethodDescriptor.<com.google.protobuf.Int64Value, com.google.protobuf.Empty>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "updateLastLoginTime"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.google.protobuf.Int64Value.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.google.protobuf.Empty.getDefaultInstance()))
              .setSchemaDescriptor(new UserServiceMethodDescriptorSupplier("updateLastLoginTime"))
              .build();
        }
      }
    }
    return getUpdateLastLoginTimeMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.google.protobuf.Empty,
      ai.people.core.grpc.lib.user.NonAdminUserResponse> getListNonAdminUsersMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "listNonAdminUsers",
      requestType = com.google.protobuf.Empty.class,
      responseType = ai.people.core.grpc.lib.user.NonAdminUserResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<com.google.protobuf.Empty,
      ai.people.core.grpc.lib.user.NonAdminUserResponse> getListNonAdminUsersMethod() {
    io.grpc.MethodDescriptor<com.google.protobuf.Empty, ai.people.core.grpc.lib.user.NonAdminUserResponse> getListNonAdminUsersMethod;
    if ((getListNonAdminUsersMethod = UserServiceGrpc.getListNonAdminUsersMethod) == null) {
      synchronized (UserServiceGrpc.class) {
        if ((getListNonAdminUsersMethod = UserServiceGrpc.getListNonAdminUsersMethod) == null) {
          UserServiceGrpc.getListNonAdminUsersMethod = getListNonAdminUsersMethod =
              io.grpc.MethodDescriptor.<com.google.protobuf.Empty, ai.people.core.grpc.lib.user.NonAdminUserResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "listNonAdminUsers"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.google.protobuf.Empty.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  ai.people.core.grpc.lib.user.NonAdminUserResponse.getDefaultInstance()))
              .setSchemaDescriptor(new UserServiceMethodDescriptorSupplier("listNonAdminUsers"))
              .build();
        }
      }
    }
    return getListNonAdminUsersMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static UserServiceStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<UserServiceStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<UserServiceStub>() {
        @java.lang.Override
        public UserServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new UserServiceStub(channel, callOptions);
        }
      };
    return UserServiceStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static UserServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<UserServiceBlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<UserServiceBlockingStub>() {
        @java.lang.Override
        public UserServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new UserServiceBlockingStub(channel, callOptions);
        }
      };
    return UserServiceBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static UserServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<UserServiceFutureStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<UserServiceFutureStub>() {
        @java.lang.Override
        public UserServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new UserServiceFutureStub(channel, callOptions);
        }
      };
    return UserServiceFutureStub.newStub(factory, channel);
  }

  /**
   */
  public static abstract class UserServiceImplBase implements io.grpc.BindableService {

    /**
     * <pre>
     **
     *登录用户信息
     * </pre>
     */
    public void loginUserInfo(ai.people.core.grpc.lib.user.LoginRequest request,
        io.grpc.stub.StreamObserver<ai.people.core.grpc.lib.user.LoginResponse> responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getLoginUserInfoMethod(), responseObserver);
    }

    /**
     * <pre>
     **
     *更新登录时间
     * </pre>
     */
    public void updateLastLoginTime(com.google.protobuf.Int64Value request,
        io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateLastLoginTimeMethod(), responseObserver);
    }

    /**
     * <pre>
     **
     *非管理员账号
     * </pre>
     */
    public void listNonAdminUsers(com.google.protobuf.Empty request,
        io.grpc.stub.StreamObserver<ai.people.core.grpc.lib.user.NonAdminUserResponse> responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListNonAdminUsersMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getLoginUserInfoMethod(),
            io.grpc.stub.ServerCalls.asyncUnaryCall(
              new MethodHandlers<
                ai.people.core.grpc.lib.user.LoginRequest,
                ai.people.core.grpc.lib.user.LoginResponse>(
                  this, METHODID_LOGIN_USER_INFO)))
          .addMethod(
            getUpdateLastLoginTimeMethod(),
            io.grpc.stub.ServerCalls.asyncUnaryCall(
              new MethodHandlers<
                com.google.protobuf.Int64Value,
                com.google.protobuf.Empty>(
                  this, METHODID_UPDATE_LAST_LOGIN_TIME)))
          .addMethod(
            getListNonAdminUsersMethod(),
            io.grpc.stub.ServerCalls.asyncUnaryCall(
              new MethodHandlers<
                com.google.protobuf.Empty,
                ai.people.core.grpc.lib.user.NonAdminUserResponse>(
                  this, METHODID_LIST_NON_ADMIN_USERS)))
          .build();
    }
  }

  /**
   */
  public static final class UserServiceStub extends io.grpc.stub.AbstractAsyncStub<UserServiceStub> {
    private UserServiceStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected UserServiceStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new UserServiceStub(channel, callOptions);
    }

    /**
     * <pre>
     **
     *登录用户信息
     * </pre>
     */
    public void loginUserInfo(ai.people.core.grpc.lib.user.LoginRequest request,
        io.grpc.stub.StreamObserver<ai.people.core.grpc.lib.user.LoginResponse> responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getLoginUserInfoMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     * <pre>
     **
     *更新登录时间
     * </pre>
     */
    public void updateLastLoginTime(com.google.protobuf.Int64Value request,
        io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getUpdateLastLoginTimeMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     * <pre>
     **
     *非管理员账号
     * </pre>
     */
    public void listNonAdminUsers(com.google.protobuf.Empty request,
        io.grpc.stub.StreamObserver<ai.people.core.grpc.lib.user.NonAdminUserResponse> responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getListNonAdminUsersMethod(), getCallOptions()), request, responseObserver);
    }
  }

  /**
   */
  public static final class UserServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<UserServiceBlockingStub> {
    private UserServiceBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected UserServiceBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new UserServiceBlockingStub(channel, callOptions);
    }

    /**
     * <pre>
     **
     *登录用户信息
     * </pre>
     */
    public ai.people.core.grpc.lib.user.LoginResponse loginUserInfo(ai.people.core.grpc.lib.user.LoginRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getLoginUserInfoMethod(), getCallOptions(), request);
    }

    /**
     * <pre>
     **
     *更新登录时间
     * </pre>
     */
    public com.google.protobuf.Empty updateLastLoginTime(com.google.protobuf.Int64Value request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getUpdateLastLoginTimeMethod(), getCallOptions(), request);
    }

    /**
     * <pre>
     **
     *非管理员账号
     * </pre>
     */
    public ai.people.core.grpc.lib.user.NonAdminUserResponse listNonAdminUsers(com.google.protobuf.Empty request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getListNonAdminUsersMethod(), getCallOptions(), request);
    }
  }

  /**
   */
  public static final class UserServiceFutureStub extends io.grpc.stub.AbstractFutureStub<UserServiceFutureStub> {
    private UserServiceFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected UserServiceFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new UserServiceFutureStub(channel, callOptions);
    }

    /**
     * <pre>
     **
     *登录用户信息
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<ai.people.core.grpc.lib.user.LoginResponse> loginUserInfo(
        ai.people.core.grpc.lib.user.LoginRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getLoginUserInfoMethod(), getCallOptions()), request);
    }

    /**
     * <pre>
     **
     *更新登录时间
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> updateLastLoginTime(
        com.google.protobuf.Int64Value request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getUpdateLastLoginTimeMethod(), getCallOptions()), request);
    }

    /**
     * <pre>
     **
     *非管理员账号
     * </pre>
     */
    public com.google.common.util.concurrent.ListenableFuture<ai.people.core.grpc.lib.user.NonAdminUserResponse> listNonAdminUsers(
        com.google.protobuf.Empty request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getListNonAdminUsersMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_LOGIN_USER_INFO = 0;
  private static final int METHODID_UPDATE_LAST_LOGIN_TIME = 1;
  private static final int METHODID_LIST_NON_ADMIN_USERS = 2;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final UserServiceImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(UserServiceImplBase serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_LOGIN_USER_INFO:
          serviceImpl.loginUserInfo((ai.people.core.grpc.lib.user.LoginRequest) request,
              (io.grpc.stub.StreamObserver<ai.people.core.grpc.lib.user.LoginResponse>) responseObserver);
          break;
        case METHODID_UPDATE_LAST_LOGIN_TIME:
          serviceImpl.updateLastLoginTime((com.google.protobuf.Int64Value) request,
              (io.grpc.stub.StreamObserver<com.google.protobuf.Empty>) responseObserver);
          break;
        case METHODID_LIST_NON_ADMIN_USERS:
          serviceImpl.listNonAdminUsers((com.google.protobuf.Empty) request,
              (io.grpc.stub.StreamObserver<ai.people.core.grpc.lib.user.NonAdminUserResponse>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }
  }

  private static abstract class UserServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    UserServiceBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return ai.people.core.grpc.lib.user.User.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("UserService");
    }
  }

  private static final class UserServiceFileDescriptorSupplier
      extends UserServiceBaseDescriptorSupplier {
    UserServiceFileDescriptorSupplier() {}
  }

  private static final class UserServiceMethodDescriptorSupplier
      extends UserServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    UserServiceMethodDescriptorSupplier(String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (UserServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new UserServiceFileDescriptorSupplier())
              .addMethod(getLoginUserInfoMethod())
              .addMethod(getUpdateLastLoginTimeMethod())
              .addMethod(getListNonAdminUsersMethod())
              .build();
        }
      }
    }
    return result;
  }
}
